// 版权归 瞄你个汪 所有。使用本代码应遵守相关法律法规和Apache 2.0开源许可要求。
package top.geeke.database.seed;

import top.geeke.constants.AppConstPool;
import top.geeke.entity.SysOrg;
import top.geeke.toolkit.supertable.seed.SuperSeedData;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系统组织结构表种子数据
 * </p>
 *
 * @author 瞄你个汪
 * @since 2024/5/26 8:13
 */
public class SysOrgSeedData implements SuperSeedData<SysOrg> {
    @Override
    public List<SysOrg> getSeedData() {
        return new ArrayList<SysOrg>(){{
            add(newInstance(1300000000101L, 0L,"XXX公司", "1001", "101", 1,"XXX公司", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000102L, 1300000000101L,"市场部", "100101", null, 2,"市场部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000103L, 1300000000101L,"研发部", "100102", null, 2,"研发部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000104L, 1300000000101L,"财务部", "100103", null, 2,"财务部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000105L, 1300000000104L,"财务部1", "10010301", null, 3,"财务部1", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000106L, 1300000000104L,"财务部2", "10010302", null, 3,"财务部2", AppConstPool.PRIMARY_ID));

            add(newInstance(1300000000201L, 0L,"分公司1", "1002", "201", 1,"分公司1", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000202L, 1300000000201L,"市场部", "100101", null, 2,"市场部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000203L, 1300000000201L,"研发部", "100102", null, 2,"研发部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000204L, 1300000000201L,"财务部", "100103", null, 2,"财务部", AppConstPool.PRIMARY_ID));

            add(newInstance(1300000000301L, 0L,"分公司2", "1003", "201", 1,"分公司2", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000302L, 1300000000301L,"市场部", "100101", null, 2,"市场部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000303L, 1300000000301L,"研发部", "100102", null, 2,"研发部", AppConstPool.PRIMARY_ID));
            add(newInstance(1300000000304L, 1300000000301L,"财务部", "100103", null, 2,"财务部", AppConstPool.PRIMARY_ID));
        }};
    }

    public SysOrg newInstance(Long id, Long pId, String name, String code, String type, int level, String remark, Long tenantId) {
        SysOrg org = new SysOrg();
        org.setId(id);
        org.setPId(pId);
        org.setOrgName(name);
        org.setOrgCode(code);
        org.setOrgType(type);
        org.setOrgLevel(level);
        org.setRemark(remark);
        org.setTenantId(tenantId);
        return org;
    }
}
